const getDictListByType = '/admin/dict/getDictListByType/'
const getEquipmentAll = '/pbms/arcequipment/getEquipmentAll'
const getDeviceTypeAll = '/pbms/arcdevicetype/getDeviceTypeAll/'
const getUserAll = '/admin/user/getUserAll'
const getDeviceManufacturerAll = '/pbms/arcmanufacturer/getDeviceManufacturerAll'
const getListByManufacturerId = '/pbms/arcmodel/getListByManufacturerId/'

export const tableOption = {
  "border": true,
  "index": true,
  "indexLabel": "序号",
  "stripe": true,
  "menuAlign": "center",
  "align": "center",
  "searchMenuSpan": 6,
  "column": [
    {
      "type": "select",
      "label": "设备编码",
      "prop": "equipmentCode",
      "span": 12,
      rules: [
        { required: true, message: '请选择启用状态', trigger: 'blur' }
      ],
      "dicUrl": getEquipmentAll,
      props: {
        label: 'equipmentName',
        value: 'equipmentCode'
      },
      hide: true
    }, {
      "type": "input",
      "label": "装置编码",
      "prop": "deviceCode",
      "span": 12,
      tip: "唯一的编码，有且只要有一个",
      rules: [
        { required: true, message: '装置编码不能为空', trigger: 'blur' },
        { min: 2, max: 30, message: '长度在 2 到 30 个字符', trigger: 'blur' }
      ]
    }, {
      "type": "input",
      "label": "识别码",
      "prop": "identificationCode",
      "span": 12,
      rules: [
        { required: true, message: '装置识别码不能为空', trigger: 'blur' },
        { min: 2, max: 30, message: '长度在 2 到 30 个字符', trigger: 'blur' }
      ]
    }, {
      "type": "input",
      "label": "装置名称",
      "prop": "deviceName",
      "span": 12,
      rules: [
        { required: true, message: '装置名称不能为空', trigger: 'blur' },
        { min: 2, max: 60, message: '长度在 2 到 60 个字符', trigger: 'blur' }
      ]
    }, {
      "type": "select",
      "label": "装置类型",
      "prop": "deviceTypeId",
      "span": 12,
      "dicUrl": getDeviceTypeAll + "10M10000000000284",
      props: {
        label: 'typeName',
        value: 'deviceTypeId'
      }
    }, {
      "type": "select",
      "label": "装置厂商",
      "prop": "manufacturerId",
      "span": 12,
      "dicUrl": getDeviceManufacturerAll,
      props: {
        label: 'manufacturerName',
        value: 'manufacturerId'
      }
    }, {
      "type": "select",
      "label": "装置型号",
      "prop": "modelId",
      "span": 12, 
      "dicUrl": getListByManufacturerId + "jaas",
      props: {
        label: 'modelName',
        value: 'modelId'
      }
    }, {
      "type": "select",
      "label": "装置状态",
      "prop": "status",
      "span": 12,
      'search': true,
      rules: [
        { required: true, message: '请选择装置状态', trigger: 'blur' }
      ],
      "dicUrl": getDictListByType + "arc_device_status",
      props: {
        label: 'label',
        value: 'value'
      }
    }, {
      "type": "select",
      "label": "启用状态",
      "prop": "runStatus",
      "span": 12,
      'search': true,
      rules: [
        { required: true, message: '请选择启用状态', trigger: 'blur' }
      ],
      "dicUrl": getDictListByType + "arc_device_run_status",
      props: {
        label: 'label',
        value: 'value'
      }
    }, {
      "type": "input",
      "label": "网关",
      "prop": "gateway",
      "span": 12,
      hide: true
    }, {
      "type": "select",
      "label": "指令类型",
      "prop": "instructionType",
      "span": 12,
      hide: true,
      dicData: [{
        label: '有停止时间',
        value: 1
      }, {
        label: '无停止时间',
        value: 2
      }]
    }, {
      "type": "number",
      "label": "启闭总时间",
      "prop": "openCloseTime",
      "span": 12,
      hide: true
    }, {
      "type": "select",
      "label": "修正规则",
      "prop": "amendmentRules",
      "span": 12,
      hide: true,
      "dicUrl": getDictListByType + "amendment_rules",
      props: {
        label: 'label',
        value: 'value'
      }
    }, {
      "type": "input",
      "label": "修正值",
      "prop": "correctionValue",
      "span": 12,
      hide: true
    }, {
      "type": "input",
      "label": "创建时间",
      "prop": "createTime",
      "span": 12,
      editDisplay: false,
      addDisplay: false,
      showClomnu: false,
      hide: true
    }, {
      "type": "input",
      "label": "创建人",
      "prop": "createUser",
      "span": 12,
      editDisplay: false,
      addDisplay: false,
      showClomnu: false,
      hide: true,
      "dicUrl": getUserAll,
      props: {
        label: 'username',
        value: 'userId'
      }
    }, {
      "type": "input",
      "label": "修改时间",
      "prop": "updateTime",
      "span": 12,
      editDisplay: false,
      addDisplay: false,
      showClomnu: false,
      hide: true
    }, {
      "type": "input",
      "label": "修改人",
      "prop": "updateUser",
      "span": 12,
      editDisplay: false,
      addDisplay: false,
      showClomnu: false,
      hide: true
    }]
}
